//
//  XJLocalTravelViewController.m
//  XinJiangMall
//
//  Created by RaoBo on 2018/6/4.
//  Copyright © 2018年 Tzyang. All rights reserved.
//  本地旅游

#import "XJLocalTravelViewController.h"
#import "XJLocalTravelDetailVC.h" // 7-3下面具体要展示的数据

//vendor
#import <SDCycleScrollView.h>
#import "YNPageViewController.h"

@interface XJLocalTravelViewController () <YNPageViewControllerDataSource, YNPageViewControllerDelegate>
@end

@implementation XJLocalTravelViewController


#pragma mark - 一 网易效果-配置信息(最先调用的方法)
// 先创建后面再改动。
+ (instancetype)suspendCenterPageVCWithBannerImgArr:(NSArray *)imgArr vcsArr:(NSArray *)vcArr titleArr:(NSArray *)titleArr {

    YNPageConfigration *configration = [YNPageConfigration defaultConfig];
    
    configration.pageStyle = YNPageStyleSuspensionCenter;
    configration.headerViewCouldScale = YES;
    configration.headerViewScaleMode = YNPageHeaderViewScaleModeTop;
    configration.showTabbar = NO;
    configration.showNavigation = YES;
    configration.scrollMenu = NO;
    configration.aligmentModeCenter = NO;
    configration.lineWidthEqualFontWidth = YES;
    configration.showBottomLine = YES;
    
    XJLocalTravelViewController *localVC = [XJLocalTravelViewController pageViewControllerWithControllers:vcArr titles:titleArr config:configration];
    
    SDCycleScrollView *autoScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0, KWidth, KWidth*0.5) imageURLStringsGroup:imgArr];
    autoScrollView.backgroundColor = [UIColor whiteColor];
    //    autoScrollView.delegate = localVC;
    localVC.headerView = autoScrollView;
    
    localVC.delegate = localVC;
    localVC.dataSource = localVC;
    localVC.pageIndex = 0; //默认选中第一个(全部)
    
    return localVC;
}

#pragma mark - YNPageViewControllerDataSource
- (UIScrollView *)pageViewController:(YNPageViewController *)pageViewController pageForIndex:(NSInteger)index {
    UIViewController *vc = pageViewController.controllersM[index];
    
    return [(XJLocalTravelDetailVC *)vc tableView];
}

#pragma mark - YNPageViewControllerDelegate
- (void)pageViewController:(YNPageViewController *)pageViewController
            contentOffsetY:(CGFloat)contentOffset
                  progress:(CGFloat)progress {
    //        NSLog(@"--- contentOffset = %f,    progress = %f", contentOffset, progress);
}

#pragma mark - 二 生命周期
- (void)viewDidLoad {
    [super viewDidLoad];
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}



@end

